package com.qianya.oa.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.ToString;

import javax.validation.constraints.Min;

/**
 * Created by admin
 */
@ToString
public class BasePageReqDto {

    /**
     * 分页查询每页条数
     */
    @ApiModelProperty(value = "分页查询每页条数")
    @Min(value = 1, message = "分页条数最小值1")
    private Integer pageSize = 20;

    /**
     * 分页查询起始查询页数
     */
    @ApiModelProperty(value = "分页查询起始查询页数（起始值1）")
    @Min(value = 1, message = "起始页最小值1")
    private Integer pageNum = 1;

    public Integer getPageSize() {
        return null == pageSize ? 20 : pageSize;
    }

    public void setPageSize(Integer size) {
        this.pageSize = size;
    }

    public Integer getPageNum() {
        return (null == pageNum ? 0 : pageNum) < 1 ? 0 : pageNum;
    }

    public void setPageNum(Integer page) {
        this.pageNum = page;
    }
}
